package com.briup.server.domain.dto;

import com.briup.common.constraints.Add;
import com.briup.common.constraints.Update;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Null;
import lombok.Data;

import java.util.List;

/**
 * 角色新增或修改数据时的DTO实体
 */
@Data
public class RoleModifiedDTO {
    @NotNull(groups = Update.class, message = "修改角色时id不能为null")
    @Null(groups = Add.class, message = "新增角色时id必须为null")
    private Long id;
    @NotBlank(message = "角色名不能为空")
    private String name;
    @NotBlank(message = "角色备注（描述）不能为空")
    private String remark;
    @NotEmpty(message = "角色对应的权限id列表不能为空")
    private List<Integer> menuIds;
}
